/** Colors for DirectX
**
** @version: $Id: Colors.h 64 2010-11-25 20:46:39Z NeurobaticsTim@gmail.com $
*/
#pragma once
#include "d3dx9.h"


const D3DXCOLOR NONE			= D3DXCOLOR(0.0f, 0.0f, 0.0f, 0.0f);	// alpha == 0 means invisible
const D3DXCOLOR CLEAR			= NONE;

const D3DXCOLOR WHITE			= D3DXCOLOR(1.0f,   1.0f,   1.0f,   1.0f);
const D3DXCOLOR BLACK			= D3DXCOLOR(0.0f,   0.0f,   0.0f,   1.0f);
const D3DXCOLOR GRAY			= D3DXCOLOR(0.5f,   0.5f,   0.5f,   1.0f);
const D3DXCOLOR LIGHT_GRAY		= D3DXCOLOR(0.8f,   0.8f,   0.8f,   1.0f);

const D3DXCOLOR RED				= D3DXCOLOR(1.0f,   0.0f,   0.0f,   1.0f);
const D3DXCOLOR GREEN			= D3DXCOLOR(0.0f,   1.0f,   0.0f,   1.0f);
const D3DXCOLOR BLUE			= D3DXCOLOR(0.0f,   0.0f,   1.0f,   1.0f);

const D3DXCOLOR CYAN			= D3DXCOLOR(0.0f,   1.0f,   1.0f,   1.0f);
const D3DXCOLOR MAGENTA			= D3DXCOLOR(1.0f,   0.0f,   1.0f,   1.0f);
const D3DXCOLOR YELLOW			= D3DXCOLOR(1.0f,   1.0f,   0.0f,   1.0f);

const D3DXCOLOR ORANGE			= D3DXCOLOR(1.0f,   0.5f,   0.0f,   1.0f);
const D3DXCOLOR PURPLE			= D3DXCOLOR(0.749f, 0.0f,   1.0f,   1.0f);

const D3DXCOLOR LIGHT_BLUE		= D3DXCOLOR(0.35f,  0.53f,  0.7f,   1.0f);

const D3DXCOLOR GOLD			= D3DXCOLOR(1.0f,   0.954f, 0.392f, 1.0f);
const D3DXCOLOR GOLD2			= D3DXCOLOR(1.0f,   0.8f,   0.2f,   1.0f);
const D3DXCOLOR BRONZE			= D3DXCOLOR(1.0f,   0.588f, 0.04f,  1.0f);
const D3DXCOLOR COPPER			= D3DXCOLOR(0.722f, 0.451f, 0.2f,   1.0f);
const D3DXCOLOR SILVER			= D3DXCOLOR(0.75f,  0.75f,  0.75f,  1.0f);
const D3DXCOLOR COBALT_BLUE		= D3DXCOLOR(0.0f,   0.311f, 0.75f,  1.0f);

const D3DXCOLOR RUBY			= D3DXCOLOR(0.88f,  0.07f,  0.25f,  1.0f);
const D3DXCOLOR EMERALD			= D3DXCOLOR(0.31f,  0.78f,  0.47f,  1.0f);
const D3DXCOLOR SAPPHIRE		= D3DXCOLOR(0.03f,  0.15f,  0.40f,  1.0f);

/* DeVry official colors */
const D3DXCOLOR DEVRY_BLUE1		= D3DXCOLOR(0.063f, 0.231f, 0.408f, 1.0f);
const D3DXCOLOR DEVRY_BLUE2		= D3DXCOLOR(0.035f, 0.212f, 0.471f, 1.0f);
const D3DXCOLOR DEVRY_GOLD1		= D3DXCOLOR(0.820f, 0.596f, 0.0f,   1.0f);
const D3DXCOLOR DEVRY_GOLD2		= D3DXCOLOR(0.820f, 0.592f, 0.0f,   1.0f);
const D3DXCOLOR DEVRY_RED1		= D3DXCOLOR(0.929f, 0.090f, 0.122f, 1.0f);
const D3DXCOLOR DEVRY_RED2		= D3DXCOLOR(0.949f, 0.0f,   0.090f, 1.0f);
const D3DXCOLOR DEVRY_WHITE		= D3DXCOLOR(1.0f,   1.0f,   1.0f,   1.0f);


/*****************************************************\
* HSICOLOR                                            *
*    like D3DXCOLOR but with HSI names instead of RGB *
\*****************************************************/
class HSICOLOR
{
public:
	/* hue, saturation, intensity, alpha (transparency) */
	float h, s, i, a;

	/* constructor */
	inline HSICOLOR(const float h, const float s, const float i, const float a)
	  : h(h), s(s), i(i), a(a)
	{
	}
};

/* Functions defined in Color.cpp */

/*****************************************************\
* Scale a color except for alpha                      *
\*****************************************************/
extern D3DXCOLOR CScale(float fScale, D3DXCOLOR cColor);


/*****************************************************\
* RGB to HSI color space                              *
*  for manipulation of color, intensity, saturation   *
\*****************************************************/
extern HSICOLOR RGB2HSI(const D3DXCOLOR RGB);


/*****************************************************\
* HSI to RGB color space                              *
\*****************************************************/
extern D3DXCOLOR HSI2RGB(const HSICOLOR HSI);


/*****************************************************\
* Cycle color: use HSI to tweak color only            *
\*****************************************************/
extern D3DXCOLOR CycleColor(const D3DXCOLOR RGB, const float fIncrement);
